package me.firstapp.module.weixin.member;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import me.firstapp.module.base.BaseEntity;

@Entity
@Table(name = "PAYMENT_RECORD")
public class PaymentRecord extends BaseEntity {

	private static final long serialVersionUID = 4596337664315146973L;

	public static final int STATUS_FAIL = 0;
	public static final int STATUS_SUCCESS = 1;
	public static final int STATUS_EXP = 2;

	// 订单号
	@Column(name = "ORDER_NO", length = 50, unique = true, nullable = false)
	private String orderNo;

	// 微信openId
	@Column(name = "OPEN_ID", length = 40, nullable = false)
	private String openId;

	// 卡号
	@Column(name = "CARD_NO", length = 40, nullable = false)
	private String cardNo;

	// 第三方支付平台单号
	@Column(name = "THIRD_PAY_NO", length = 50)
	private String thirdPayNo;

	// 支付金额
	@Column(name = "PAY_AMOUNT", columnDefinition = "DECIMAL(11, 2)", nullable = false)
	private BigDecimal payAmount;

	// 状态0,失败，1,成功，2,异常
	@Column(name = "STATUS", columnDefinition = "TINYINT", nullable = false)
	private Integer status;

	// 支付时间
	@Column(name = "PAY_TIME", columnDefinition = "DATETIME", nullable = false)
	private Date payTime;

	// 错误码
	@Column(name = "ERROR_CODE")
	private String errorCode;

	// 错误描述信息
	@Column(name = "ERROR_DESC")
	private String errorDesc;

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public Date getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getThirdPayNo() {
		return thirdPayNo;
	}

	public void setThirdPayNo(String thirdPayNo) {
		this.thirdPayNo = thirdPayNo;
	}

	public BigDecimal getPayAmount() {
		return payAmount;
	}

	public void setPayAmount(BigDecimal payAmount) {
		this.payAmount = payAmount;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorDesc() {
		return errorDesc;
	}

	public void setErrorDesc(String errorDesc) {
		this.errorDesc = errorDesc;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

}
